<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
    <link href="<%=request.getContextPath()%>/css/index.css" rel="stylesheet">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/bootstrap.min.css">
    <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css">
    <link rel='stylesheet' href='https://unicons.iconscout.com/release/v2.1.9/css/unicons.css'>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/foot.css" />
    <link href="<%=request.getContextPath()%>/css/index01.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/css/loading.css" rel="stylesheet" type="text/css">
    <style>
        html {
            font-family: 微软雅黑, serif;
            color: #333333;
        }
        a {
            color: #1D8CE0;
            cursor: pointer;
        }
        * {
            margin: 0px;
            padding: 0px;
        }
    </style>


</head>
<body style="background: #eee;">
<%--导航条--%>
<%@include file="../common/nav.jsp"%>

<div style="width: 80%;background: white; border-radius: 5px; height: 500px;margin:0 auto;padding: 20px;">
    <div style="display: flex;font-size: 18px;padding: 10px;float:left;">
        <span>本次测试成绩:</span>
        <div style="margin-left: 20px;color: red"><strong id="scroce"></strong></div>
    </div>
    <div style="display: flex;font-size: 18px;padding: 10px;">
        <span>正确题数:  </span>
        <div  style="margin-left:18px;color: red "><span id="number"></span>/17</div>
    </div>
    <table class="table" style="margin: 10px;">
        <caption><h3>错题 :</h3></caption>
        <thead>
        <tr>
            <td style="width: 8%">题目类型</td>
            <th>题目内容</th>
            <th style="width: 10%">您的答案</th>
            <th style="width: 10%">正确答案</th></tr>
        </thead>
        <tbody>
        <c:forEach  items="${wrongList}" var="w" >
            <tr class="active">
                <td>${w.wrongType}</td>
                <td>${w.wrongStem}</td>
                <td>${w.wrongAnswer}</td>
                <td>${w.trueAnswer}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <a href="/yuezhi/index.action"><button class="btn-info" style="width: 100px;height: 50px;border: none;float: right">返回主页</button></a>
    <%--<a href="personinfo.html"><button class="btn-success" style="width: 100px;height: 50px;border: none;float: right">加入错题集</button></a>--%>
</div>




<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.min.js" ></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.min.js" ></script>

<script>
    $(function(){
        var wrong = ${wrongList};
        var length = wrong.length;
        $("#number").text(17 - length);
        var scorce = 0;
        for (var i = 0; i < wrong.length; i++){
            if (wrong[i].wrongType == "编程题"){
                scorce = scorce + 20;
            }
            else{
                scorce = scorce + 5;
            }
        }
        console.log(scorce)
        $("#scroce").html(100 -  scorce);

    })

</script>

</body>


</html>
